Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add v4 backward compatibility #309

Merged
merged 3 commits into from
Dec 22, 2024

Conversation

gdelataillade
Copy link
Owner

To ensure seamless transition for users upgrading from v4 to v5, the AlarmSettings class has been modified to include backward compatibility. This update addresses potential issues when retrieving alarms created in v4, ensuring that all settings, including dateTime and volumeSettings, are correctly interpreted and converted in v5.

@gdelataillade
Copy link
Owner Author

Key changes include:

  • VolumeSettings: Automatically generate volumeSettings for v4 alarms, using existing volume-related fields.
  • DateTime Conversion: Convert dateTime from microseconds (v4) to milliseconds (v5) to ensure accurate alarm scheduling.
  • Default Values: Set default values for fields introduced in v5, such as allowAlarmOverlap.

@gdelataillade
Copy link
Owner Author

Hi @orkun1675,

I wanted to get your thoughts on the code, as you wrote most of the code I modified, and you have more expertise with native iOS and Android code than I do. If it looks good to you, I'll go ahead and merge it so we can release version 5.0.0 soon.

Thanks!

@gdelataillade gdelataillade added the reviewing This PR is being reviewed label Dec 18, 2024
Copy link
Contributor

@orkun1675 orkun1675 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, left a few minor comments.

lib/model/alarm_settings.dart Show resolved Hide resolved
lib/model/alarm_settings.dart Outdated Show resolved Hide resolved
ios/Classes/models/AlarmSettings.swift Show resolved Hide resolved
Copy link
Contributor

@orkun1675 orkun1675 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'd recommend testing this though as it's hard to ensure data type safety by reading the code.

Looking forward to V5!

ios/Classes/models/AlarmSettings.swift Show resolved Hide resolved
lib/model/alarm_settings.dart Outdated Show resolved Hide resolved
@gdelataillade gdelataillade merged commit dd5c4dc into main Dec 22, 2024
1 check passed
@gdelataillade
Copy link
Owner Author

PR added to version 5.0.0-dev.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewing This PR is being reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants